﻿using System;
using System.Collections.Generic;
using System.Text;
using MsDAL;
using ServiceHelper.Util;

namespace ServiceHelper
{
    public class Sys0a60Manager
    {
        Sys0a60DAL dal = new Sys0a60DAL();

        private static Sys0a60Manager _entity;

        public static Sys0a60Manager Entity
        {
            get
            {
                if (_entity == null)
                    _entity = new Sys0a60Manager();
                return _entity;
            }
        }

        /// <summary>
        ///生成新编码
        /// </summary>
        /// <param name="snName"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public string CreateSn(string snName, string userName)
        {
            userName = string.IsNullOrEmpty(userName) ? "SYSTEM" : userName;
            return dal.CreateSn(snName, userName);
        }

        public string CreateSn(string snName)
        {
            var userName = ServerContext.UserCode;
            userName = string.IsNullOrEmpty(userName) ? "SYSTEM" : userName;
            return dal.CreateSn(snName, userName);
        }
    }
}
